import java.io.*;
import java.net.Socket;
import java.util.HashMap;

public class ClientTest {
    public static void main(String[] args) {
        Socket s;
        InputStream in;
        OutputStream out;//jlj
        try {
            s = new Socket("127.0.0.1", 12345);
            in = s.getInputStream();
            out = s.getOutputStream();
//            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(out));
//            String line = null;
//            while ((line = br.readLine()) != null) {
//                if (line == "bye")
//                    break;
//                out.write(Integer.parseInt(line));
//            }
            ObjectOutputStream oos=new ObjectOutputStream(out);
            ObjectInputStream ois=new ObjectInputStream(in);
            Snake snake = new Snake();
            int count=0;
            while (++count<10000)
                oos.writeObject(snake);
            s.close();

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
